package com.woniu.bank.controller;

import com.woniu.bank.dto.PermissionDTO;
import com.woniu.bank.service.SysPermissionService;
import com.woniu.bank.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: WangHeng
 * @Date: 2023/1/3 14:31
 */
@RestController
@RequestMapping("permissions")
@Api(tags = "权限接口",description = "所有的权限接口")
public class PermissionController {
    @Autowired
    private SysPermissionService permissionService;

    @ApiOperation(value = "修改角色的权限",notes ="角色赋予新的权限",httpMethod="PUT")
    @PutMapping("savePers")
    public Result savePermission(@RequestBody PermissionDTO permissionDTO){
        permissionService.updatePermissionByRid(permissionDTO);
        return Result.ok();
    }
}
